package cn.ichiva.dl4j.gnn.mnist;

import cn.ichiva.dl4j.gnn.common.Agent;
import cn.ichiva.dl4j.gnn.common.AgentConfig;
import lombok.Getter;
import lombok.Setter;
import org.nd4j.linalg.api.ndarray.INDArray;

import java.util.concurrent.atomic.AtomicInteger;

@Getter
@Setter
public class MnistAgent extends Agent {

    private static final AtomicInteger index = new AtomicInteger(0);

    /**
     * 环境适应分数
     */
    private double score;

    /**
     * 验证分数
     */
    private double validScore;

    public MnistAgent(AgentConfig config) {
        this(config,null);
    }

    public MnistAgent(AgentConfig config, INDArray dna) {
        super(config, dna);
        setName("agent-" + index.incrementAndGet());
    }

    public static AgentConfig mnistConfig = new MnistConfig();

    public static MnistAgent newInstance(){
        return new MnistAgent(mnistConfig);
    }

    public static MnistAgent create(INDArray dna){
        return new MnistAgent(mnistConfig,dna);
    }
}
